{template 'common/header'}
<ul class="nav nav-tabs">
    <li><a href="{php echo $this->createWebUrl('user');}">用户管理</a></li>
</ul>

<div class="main">
    <form action="" id="form" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default">
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">姓名</label>
                    <div class="col-sm-5">
                        <input type="text" name="username" class="form-control" value="{$takechip['name']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">电话号码</label>
                    <div class="col-sm-5">
                        <input type="text" name="phone" class="form-control" value="{$takechip['phone']}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">部门</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="bumen" id="pid">
                            {loop $bumen $index $item}
                            <option value="{$item['id']}" {if $takechip['bumen'] == $item['id']}selected="selected"{/if} >{$item['name']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">子部门</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="jingwushi" id="pid2">
                            {loop $jingwushi $index $item}
                            <option value="{$item['id']}" {if $takechip['jingwushi'] == $item['id']}selected="selected"{/if} >{$item['name']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">职位</label>
                    <div class="col-sm-5">
                        <select class="form-control" name="zhiwu">
                            {loop $zhiwu $index $item}
                            <option value="{$item['id']}" {if $takechip['zhiwu'] == $item['id']}selected="selected"{/if} >{$item['name']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                    <div class="col-sm-5">
                        <label class="radio-inline">
                            <input type="radio" name="static" value="1" {if $takechip['static'] ==1}checked="true"{/if}>已通过
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="static" value="0" {if $takechip['static'] ==0}checked="true"{/if}>待审核
                        </label>
                    </div>
                </div>

            </div>
            <div class="form-group col-sm-12">
                <input type="hidden" name="token" value="{$_W['token']}"/>
                <input type="hidden" name="uid" value="{$takechip['uid']}"/>
                <input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交"/>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">

    $(document).ready(function () {
        var val = $('#pid').val();
        change_pid(val);
        $('#pid').bind("change", function () {
            var v = $(this).val();
            $.post("../app/{php echo $this->createMobileUrl('pid')}", {'pid': v},
                function (data) {
                    $('#pid2').html(data);
                });
        });
    });
    function change_pid(v) {
        $.post("../app/{php echo $this->createMobileUrl('pid')}", {'pid': v},
            function (data) {
                $('#pid2').html(data);
            });
    }
</script>
{template 'common/footer'}